package enumeration;

/**
 * Created with IntelliJ IDEA
 * Description:用enum创建枚举
 * User:22954
 * Date:2024-01-26
 * Time:3:59
 */
enum Season2 {
    /**
     * 1.用变量名+()来创建枚举对象 例:A()
     * 2.枚举对象必须写在枚举类的首行
     * 3.多个枚举对象之间用 "," 间隔开，最后仍要";"
     * 注意:该方法前提是已经用enum替换掉class创建类
     *      枚举对象调用无参构造器时可以省略()
     */
    SPRING("spring", "warm"),
    SUMMER("summer", "hot"),
    AUTUMN("autumn", "cool"),
    WINTER("winter", "cold"),
    EXAMPLE1(),
    EXAMPLE2;
    Season2() {

    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

//    @Override
//    public String toString() {
//        return "Season2{" +
//                "name='" + name + '\'' +
//                ", desc='" + desc + '\'' +
//                '}';
//    }

    private String name;
    private String desc;

    Season2(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }
}
